﻿ <%@ Page Title="Sectores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="sectores.aspx.cs" Inherits="Restaurante.sectores"%>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
         <p id="titulo"> Sectores de Mesas </p>
    </h2>

     <div class="contTabla">
         <asp:GridView ID="gvSectores" runat="server" CellPadding="4" 
             ForeColor="#333333" GridLines="None" AllowSorting="True" 
             AutoGenerateColumns="False" DataSourceID="SectoresGrilla" 
             AllowPaging="True" DataKeyNames="Id_Sector">              
             <AlternatingRowStyle BackColor="White" />
             <Columns>
                 <asp:BoundField DataField="Id_Sector" 
                     HeaderText="Id_Sector" SortExpression="Id_Sector" InsertVisible="False" 
                     ReadOnly="True" />
                 <asp:BoundField DataField="Descripcion" 
                     HeaderText="Descripcion" SortExpression="Descripcion" />
             </Columns>
             <EditRowStyle BackColor="#2461BF" />
             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
             <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
             <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
             <RowStyle BackColor="#EFF3FB" />
             <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
             <SortedAscendingCellStyle BackColor="#F5F7FB" />
             <SortedAscendingHeaderStyle BackColor="#6D95E1" />
             <SortedDescendingCellStyle BackColor="#E9EBEF" />
             <SortedDescendingHeaderStyle BackColor="#4870BE" />
         </asp:GridView>
         <asp:SqlDataSource ID="SectoresGrilla" runat="server" 
             ConnectionString="<%$ ConnectionStrings:BarCafe %>" 
             DeleteCommand="DELETE FROM [Sector] WHERE [Id_Sector] = @Id_Sector" 
             InsertCommand="INSERT INTO [Sector] ([Descripcion]) VALUES (@Descripcion)" 
             ProviderName="<%$ ConnectionStrings:BarCafe.ProviderName %>" SelectCommand="SELECT * FROM [Sector]" 
             
             
             
             
             
             UpdateCommand="UPDATE [Sector] SET [Descripcion] = @Descripcion WHERE [Id_Sector] = @Id_Sector">
             <DeleteParameters>
                 <asp:Parameter Name="Id_Sector" Type="Int32" />
             </DeleteParameters>
             <InsertParameters>
                 <asp:Parameter Name="Descripcion" Type="String" />
             </InsertParameters>
             <UpdateParameters>
                 <asp:Parameter Name="Descripcion" Type="String" />
                 <asp:Parameter Name="Id_Sector" Type="Int32" />
             </UpdateParameters>
         </asp:SqlDataSource>
    </div>

     <div class="contTabla">
        <table>
         <tr>
            <td class="style1">
                <asp:Label ID="Label3" runat="server" Text="Ingrese el Sector de la mesa:"></asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txbDescripcion" runat="server" MaxLength="30" ></asp:TextBox>
            </td>       
        </tr>

        </table>
         <br />
         <br />
        <asp:Button ID="btnAceptar" runat="server" Text="Aceptar" 
             onclick="btnAceptar_Click" />
            
        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
             onclick="btnCancelar_Click" />

    </div>    
</asp:Content>

